{% extends "base.html" %}
{% load djblets_deco %}
{% load i18n %}
{% load reviewtags %}
{% block title %}{% trans "My Dashboard" %}{% endblock %}

{% block extrahead %}
<meta http-equiv="refresh" content="300" />
{% endblock %}

{% block css %}
<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}rb/css/dashboard.css?{{MEDIA_SERIAL}}" />
<link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}djblets/css/datagrid.css?{{MEDIA_SERIAL}}" />
{% endblock %}

{% block scripts %}
<script type="text/javascript" src="{{MEDIA_URL}}djblets/js/jquery-1.3.1.min.js"></script>
{% endblock %}

{% block scripts-post %}
<script type="text/javascript" src="{{MEDIA_URL}}djblets/js/jquery-ui-1.6rc5.min.js"></script>
<script type="text/javascript" src="{{MEDIA_URL}}djblets/js/jquery.gravy.js?{{MEDIA_SERIAL}}"></script>
<script type="text/javascript" src="{{MEDIA_URL}}djblets/js/datagrid.js?{{MEDIA_SERIAL}}"></script>
<script type="text/javascript" src="{{MEDIA_URL}}rb/js/common.js?{{MEDIA_SERIAL}}"></script>
{% endblock %}

{% block content %}
{% box "dashboard" %}
<div id="dashboard-wrapper">
 <table class="datagrid" id="dashboard-navbar">
  <colgroup>
   <col class="summary" />
   <col class="count" />
  </colgroup>
  <tbody>
{% dashboard_entry "main-item" "Starred Reviews"  "starred" %}
{% dashboard_entry "main-item" "Outgoing Reviews" "outgoing" %}
{% dashboard_entry "main-item" "Incoming Reviews" "incoming" %}
{% dashboard_entry "sub-item"  "To Me"            "to-me" %}
{% for g in user.review_groups.all %}
{%  dashboard_entry "sub-item" g.name "to-group" g %}
{% endfor %}
{% ifnotequal user.get_profile.starred_groups.count 0 %}
{%  dashboard_entry "main-item" "Watched Groups" "watched-groups" %}
{%  for g in user.get_profile.starred_groups.all %}
{%   dashboard_entry "sub-item" g.name "to-group" g %}
{%  endfor %}
  </tbody>
{% endifnotequal %}
 </table>
 <div id="dashboard-main" class="clearfix">
{{datagrid.render_listview}}
 </div>
</div>
{% endbox %}
{% endblock %}
